package com.gym.controller;

import com.gym.client.EquipmentUpKeepClient;
import com.gym.pojo.Equipmentupkeep;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

@CrossOrigin
@RestController
public class EquipmentUpKeepContoller {

    @Resource
    private EquipmentUpKeepClient equipmentUpKeepClient;

    /*
     * 查询全部器材维修信息
     * */
    @GetMapping("/selAllUpKeep")
    public Map<String,Object> selAllUpKeep(Integer pageIndex,
                            @RequestParam(required = false) String equname,
                            @RequestParam(required = false) String start,
                            @RequestParam(required = false) String end) {
        return equipmentUpKeepClient.selAllUpKeep(pageIndex,equname,start,end);
    }


    /**
     * 添加器材维修信息
     * @return
     */
    @GetMapping("/addEquRepair")
    public boolean addEquRepair(Equipmentupkeep equipmentupkeep) {
        return equipmentUpKeepClient.addEquRepair(equipmentupkeep);
    }

    /*
     * 修改器材维修信息
     * */
    @GetMapping("/updateEquRepair")
    public boolean updateEquRepair(Equipmentupkeep equipmentupkeep) {
        return equipmentUpKeepClient.updateEquRepair(equipmentupkeep);
    }


    /*
     * 删除器材维修信息
     * */
    @GetMapping("/delEquRepair")
    public boolean delEquRepair(String equkeepid) {
        return equipmentUpKeepClient.delEquRepair(equkeepid);
    }


}
